{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.获取数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.1加载依赖库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import itchat #登录微信，获取好友信息\n",
    "import pandas as pd #数据分析\n",
    "import pickle # 数据存储"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.2使用itchat库获取好友信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "朋友数：\t 705\n"
     ]
    }
   ],
   "source": [
    "itchat.auto_login(True)\n",
    "friends = itchat.get_friends(update=True)\n",
    "print('朋友数：\\t', len(friends))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.3如果登陆失败，则从本地加载已有好友信息，friends.pickle文件从网络下载"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "朋友数：\t 705\n"
     ]
    }
   ],
   "source": [
    "from urllib import request\n",
    "import pickle\n",
    "\n",
    "url = 'https://yooongchun-blog-v2.oss-cn-beijing.aliyuncs.com/media/friends.pickle'\n",
    "file_stream = request.urlopen(url)  # 读取远程数据\n",
    "friends = pickle.load(file_stream)\n",
    "print('朋友数：\\t', len(friends))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.数据分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.1转换为dataframe格式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(705, 33)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(friends)\n",
    "df.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.2查看有哪些字段"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['MemberList',\n",
       " 'UserName',\n",
       " 'City',\n",
       " 'DisplayName',\n",
       " 'PYQuanPin',\n",
       " 'RemarkPYInitial',\n",
       " 'Province',\n",
       " 'KeyWord',\n",
       " 'RemarkName',\n",
       " 'PYInitial',\n",
       " 'EncryChatRoomId',\n",
       " 'Alias',\n",
       " 'Signature',\n",
       " 'NickName',\n",
       " 'RemarkPYQuanPin',\n",
       " 'HeadImgUrl',\n",
       " 'UniFriend',\n",
       " 'Sex',\n",
       " 'AppAccountFlag',\n",
       " 'VerifyFlag',\n",
       " 'ChatRoomId',\n",
       " 'HideInputBarFlag',\n",
       " 'AttrStatus',\n",
       " 'SnsFlag',\n",
       " 'MemberCount',\n",
       " 'OwnerUin',\n",
       " 'ContactFlag',\n",
       " 'Uin',\n",
       " 'StarFriend',\n",
       " 'Statues',\n",
       " 'WebWxPluginSwitch',\n",
       " 'HeadImgFlag',\n",
       " 'IsOwner']"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns.tolist()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```json\n",
    "'MemberList': '成员',\n",
    " 'UserName': '用户名(已加密)',\n",
    " 'City': '城市',\n",
    " 'DisplayName': '',\n",
    " 'PYQuanPin': '拼音全拼',\n",
    " 'RemarkPYInitial': '备注名拼音',\n",
    " 'Province': '省份',\n",
    " 'KeyWord': '',\n",
    " 'RemarkName': '备注名',\n",
    " 'PYInitial': '昵称拼音',\n",
    " 'EncryChatRoomId': '',\n",
    " 'Alias': '',\n",
    " 'Signature': '签名',\n",
    " 'NickName': '昵称',\n",
    " 'RemarkPYQuanPin': '备注名拼音全拼',\n",
    " 'HeadImgUrl': '头像地址',\n",
    " 'UniFriend': '',\n",
    " 'Sex': '性别',\n",
    " 'AppAccountFlag': '',\n",
    " 'VerifyFlag': '',\n",
    " 'ChatRoomId': '',\n",
    " 'HideInputBarFlag': '',\n",
    " 'AttrStatus': '',\n",
    " 'SnsFlag': '',\n",
    " 'MemberCount': '',\n",
    " 'OwnerUin': '',\n",
    " 'ContactFlag': '',\n",
    " 'Uin': '',\n",
    " 'StarFriend': '星标好友',\n",
    " 'Statues': '',\n",
    " 'WebWxPluginSwitch': '',\n",
    " 'HeadImgFlag': '',\n",
    " 'IsOwner': '是否本人'\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3查看字段内内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['仰望星空，脚踏实地！',\n",
       " '',\n",
       " 'sgjfetifchhfb',\n",
       " '',\n",
       " '爱水果，爱健康，爱生活',\n",
       " '揪心！',\n",
       " '',\n",
       " '像硬汉一样学习和生活。',\n",
       " '',\n",
       " '总是在做事吧~',\n",
       " '',\n",
       " '管好自己',\n",
       " '没有陌生人的世界',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '一定是特别的缘分，才可以一路走来变成一家人',\n",
       " '佛着',\n",
       " '技术时代的思行者！',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '烦恼会解决烦恼',\n",
       " '无始心熏染，心如影像般，纵现外境相，如实见境无。',\n",
       " '简单专注',\n",
       " '我遇见谁会有怎样的对白？',\n",
       " '',\n",
       " '机会难得，失去却很容易。',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '开心就好！',\n",
       " '',\n",
       " '日啖鱼干三百斤，不辞长做喵星人a',\n",
       " '',\n",
       " '🔆<span class=\"emoji emoji1f334\"></span>',\n",
       " '',\n",
       " '',\n",
       " '刚生若第一次看，啥事大风哭写字！',\n",
       " '学好C++,走遍天下都不怕。',\n",
       " '日日是好日',\n",
       " '时光旧了，我们回不去了！',\n",
       " '',\n",
       " '',\n",
       " '伤心的泪笑着流',\n",
       " '明天会更好。',\n",
       " '业精于勤荒于嬉，行成于思毁于随',\n",
       " '面对现实，忠于理想',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '美璟花舍',\n",
       " '',\n",
       " '<span class=\"emoji emoji1f48b\"></span>：এ᭄²º¹9<span class=\"emoji emoji2665\"></span>️️⋅\\xa0努力生活\\xa0🦋\\xa0Lᵒᵛᵉᵧₒᵤ<span class=\"emoji emoji1f493\"></span>',\n",
       " '做到自强不息，努力改变自己。愿厚德载物，用行动让世界更好。',\n",
       " '身在井隅，眼望星光，心底有诗，自在远方',\n",
       " '',\n",
       " '',\n",
       " '看看天空看看云',\n",
       " 'A cool fish...',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " 'www.shuaiqi.me',\n",
       " '数羊....',\n",
       " '低调做人',\n",
       " '开心最重要',\n",
       " '',\n",
       " '空谈误国，实干兴邦。冒险家。',\n",
       " '',\n",
       " '等不到天黑，看不见你流泪',\n",
       " '',\n",
       " '桃栗三年柿八年 达摩九年我一生',\n",
       " '',\n",
       " '',\n",
       " 'let life live',\n",
       " '',\n",
       " '做个对社会有用的人',\n",
       " '视此虽近 邈若山河',\n",
       " '我只是个蛇精宝宝',\n",
       " '我宁愿做错，也不愿什么都不做。',\n",
       " '',\n",
       " '社会人',\n",
       " 'Nothing to say',\n",
       " '',\n",
       " '',\n",
       " '幸福不止在于丰衣足食，更在于碧水蓝天',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '凭主意行',\n",
       " '蓝翔三年级挖掘二班，精通各种挖掘机',\n",
       " 'tomorrow will be a better day',\n",
       " '',\n",
       " 'never say goodbye',\n",
       " '近乎直觉的热情',\n",
       " '谢谢你来看我呀~~',\n",
       " '',\n",
       " '',\n",
       " 'Un artiste c’est toujours seul',\n",
       " '励志吃货一枚！',\n",
       " 'eloquent men are ringht every bit as often as imbeciles',\n",
       " '快捷 专业 专注于昆明进口红酒批发 奔富 拉菲 黄尾 洛神正品行货',\n",
       " '相遇，相知，相爱，相守',\n",
       " '',\n",
       " '英雄也投降',\n",
       " '',\n",
       " '好好学习 天天向上',\n",
       " '',\n",
       " '遥不可及的相守，咫尺天涯的相拥',\n",
       " '',\n",
       " 'QWZZMM',\n",
       " '',\n",
       " '朝于婴齐夕于侧',\n",
       " '天若挡我，捅破这天，地若拦我，踏破这地',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '不常在线，有急事直接电话',\n",
       " 'A sweet but cool girl <span class=\"emoji emoji1f481\"></span>🏻',\n",
       " '做好当前',\n",
       " '',\n",
       " '',\n",
       " '人生就是一段旅程',\n",
       " '',\n",
       " 'Live Today, Love Tomorrow, Unite Forever',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '天天睡不醒',\n",
       " '',\n",
       " '',\n",
       " 'WHY NOT ?',\n",
       " 'Later equals never',\n",
       " '',\n",
       " '想过成功，想过失败，但从没想过放弃。',\n",
       " '秘果',\n",
       " '专注、沉着、耐心、舍得',\n",
       " '终身学习',\n",
       " '是你自恋',\n",
       " '',\n",
       " '学生党一枚',\n",
       " '数码<span class=\"emoji emoji1f4f2\"></span> 音乐<span class=\"emoji emoji1f3a7\"></span> 拍照<span class=\"emoji emoji1f4f7\"></span>  骑行🚴🏻真正优秀的人，从不抱怨。',\n",
       " '人生无根蒂 飘如陌上尘',\n",
       " '早起有益',\n",
       " '多年以后。。。。',\n",
       " '春暖花开',\n",
       " '',\n",
       " '┗y ~o l o つ',\n",
       " '这个人不是一般的懒',\n",
       " '',\n",
       " '',\n",
       " '心灵不空，钱包不空',\n",
       " '个人网站：www.yuzunzhang.com',\n",
       " '时间会知道',\n",
       " '选择就是放弃，自由就是枷锁。\\n心存感激，心存畏惧。',\n",
       " '永远地chua',\n",
       " 'keep calm and carry on',\n",
       " '',\n",
       " 'life is like a box of chocolates',\n",
       " '吾日三省吾身，今日浪了没！！！',\n",
       " 'Today is the only day. ',\n",
       " '',\n",
       " 'CCC！',\n",
       " '自然选择，前进四',\n",
       " '简简单单',\n",
       " '往事不回头，余生不将就。<span class=\"emoji emoji1f497\"></span>',\n",
       " '',\n",
       " '呃。。。。。。。',\n",
       " '接收《多听，多看，多想，多问》+严谨=￥....',\n",
       " '吃下去的是委屈，消化后得到的是格局。',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '《练琴》工作室Michael老师',\n",
       " 'Песня\\xa0о\\xa0тревожной\\xa0молодости',\n",
       " '兼具匠人精神与商业思维',\n",
       " '永远相信美好的事情即将发生~',\n",
       " 'never too late',\n",
       " '',\n",
       " '不是忙着活，就是忙着死',\n",
       " '人生 苦短 要 勇敢  翻 一座山  追 一个梦  爱  一个人',\n",
       " '',\n",
       " '生活，不会亏待努力奋斗的人!',\n",
       " '',\n",
       " '',\n",
       " '我们努力使事情更简单！',\n",
       " '能遇见，真是太好了呀。',\n",
       " '岁月安好，人生如歌',\n",
       " 'Talk is cheap,show me the code.',\n",
       " '',\n",
       " '尽力而为，顺其自然',\n",
       " '',\n",
       " '🤪',\n",
       " '',\n",
       " '',\n",
       " '［2022-0803～0923］',\n",
       " '',\n",
       " '为了我所喜欢的人和喜欢我的人我会努力使自己变的更优秀Ծ‸Ծ',\n",
       " '淡泊以明志，宁静以致远。',\n",
       " '',\n",
       " '来就来呗',\n",
       " '',\n",
       " '善待身边人，除了生死都是小事',\n",
       " '此号不常用\\n新号19188336790',\n",
       " '张德祥骥智无人驾驶ALLInCreateAmind.agi.top强化学习',\n",
       " '',\n",
       " '不念过往，不畏将来',\n",
       " '厦门新号：139-5924-1469',\n",
       " '',\n",
       " '马<span class=\"emoji emoji1f434\"></span>男有态度！缓慢而坚定！',\n",
       " '',\n",
       " '别高看了别人，轻视了自己',\n",
       " '<span class=\"emoji emoji261d\"></span>🏻',\n",
       " '生活就像一面镜子，你对他笑，他就会对你笑！',\n",
       " '若批评不自由 则赞美无意义',\n",
       " '17719915222',\n",
       " 'To be a reliable man.',\n",
       " '善',\n",
       " '',\n",
       " '未来日子，多闪几倍光。',\n",
       " '',\n",
       " '你说人生艳丽我没有异议、',\n",
       " '我见青山多妩媚，料青山见我应如是。',\n",
       " '请勿爽约。若临时取消将视为一节课程，请珍惜尊重时间！',\n",
       " '13421849900',\n",
       " '',\n",
       " '人要随性一些',\n",
       " 'Bid farewell to the bygones',\n",
       " '做网站选领行网络，强团队好服务！',\n",
       " '',\n",
       " '',\n",
       " '过程即是奖励',\n",
       " '用不了手机，请其他方式联系，望勿怪',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '2020加油啦～',\n",
       " '',\n",
       " '它对我来说，就像一艘航程没有尽头的船。',\n",
       " '阳光正好。',\n",
       " '沛然充盈，恬淡丰饶',\n",
       " '当你有了足够的勇气，可能就会有足够的运气。',\n",
       " '坚守本心，无问西东',\n",
       " '每个人都有不一样的生活。那些看似完美的生活的人一定很努力',\n",
       " '发现不一样的自己',\n",
       " '',\n",
       " '在因上使力，在果上随缘',\n",
       " '不畏惧，不沉迷，不伪装',\n",
       " '为天地立心、为生民立命、为往圣继绝学、为万世开太平。',\n",
       " '想说却还没说的还很多，攒着是因为想写成歌。',\n",
       " '',\n",
       " '舒服的关系来自于懂得分寸',\n",
       " '',\n",
       " '祸莫大于不知足 咎莫大于欲得 故知足不足，常足矣',\n",
       " '',\n",
       " '',\n",
       " '身体安康很重要',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '天上的云 聚了还散',\n",
       " '不要有为难情绪嘛',\n",
       " '',\n",
       " '',\n",
       " '做简单，做平凡，做自己～',\n",
       " 'You mistake stars reflected in a pond for the night sky',\n",
       " '事与愿违',\n",
       " 'Change the world by program！',\n",
       " '想要实现梦想！求保佑！',\n",
       " '',\n",
       " 'Global Talent. Gladiator.',\n",
       " '',\n",
       " '不舍爱与自由',\n",
       " '———自律给自己自由——— \\u2003\\u2003\\u2003\\u2003\\u2003ִ',\n",
       " '',\n",
       " '不为无益之事 何以遣有涯之生',\n",
       " '世界很大，大到一转身就再也见不到。',\n",
       " '',\n",
       " 'hey，there',\n",
       " '我想认真谈场恋爱，从你开始，没有结束',\n",
       " '危年',\n",
       " '间歇性头脑发热，持续性混吃等死。',\n",
       " '',\n",
       " '',\n",
       " '<span class=\"emoji emoji2728\"></span>',\n",
       " 'Second place means you are the first loser.',\n",
       " '',\n",
       " '今天不做的事 明天也不会做了',\n",
       " '',\n",
       " '自由的一无所有',\n",
       " '我必须是你近旁的一株木棉，作为树的形象和你站在一起。',\n",
       " '？？？',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '离开不是预谋已久，只是攒够了失望自然就放下了余生和你无关了。',\n",
       " '',\n",
       " '你好，',\n",
       " '',\n",
       " '.',\n",
       " 'love 丹丹',\n",
       " '你不要乱来\\n 不要乱来\\n 要乱来\\n 乱来\\n 来',\n",
       " '',\n",
       " 'hl',\n",
       " '情为何物，生死相许！',\n",
       " '时间是带走青春的电车',\n",
       " '循此苦旅 以达天际',\n",
       " '强身健体，好好学习',\n",
       " '',\n",
       " '十年饮冰，难凉热血！',\n",
       " '愿家人平平安安<span class=\"emoji emoji1f64f\"></span> 健康是福',\n",
       " '天道酬勤',\n",
       " '风不止而树欲静',\n",
       " '',\n",
       " 'I do what I do.',\n",
       " '全面转型：互联网+文化展播、采编、管理，欢迎代理',\n",
       " '人间有味是清欢',\n",
       " '',\n",
       " '狙击手 每次精准的射击都源于内心的碰撞',\n",
       " '<span class=\"emoji emoji1f604\"></span><span class=\"emoji emoji1f604\"></span><span class=\"emoji emoji1f604\"></span><span class=\"emoji emoji1f604\"></span><span class=\"emoji emoji1f604\"></span><span class=\"emoji emoji1f604\"></span>',\n",
       " '老师已延长假期，疫情稳定我们上班后发货。如需开课24小时内通过',\n",
       " '唯愿踏实且勤恳。',\n",
       " '',\n",
       " '',\n",
       " '<span class=\"emoji emoji1f30a\"></span>',\n",
       " '唯梦闲人',\n",
       " '———该朋友圈 只对你开放<span class=\"emoji emoji1f49e\"></span> ———',\n",
       " '',\n",
       " '西出阳关',\n",
       " '飘风不终朝，骤雨不终日。',\n",
       " '别让梦想只是梦想',\n",
       " '世本无事，庸人自扰；唯通则简，冰消日皎。',\n",
       " '2020，读四本书',\n",
       " '这个人很懒，什么都没留下…',\n",
       " '',\n",
       " '既行此路，莫问前程。',\n",
       " '专业创造价值，信任成就未来。<span class=\"emoji emoji270c\"></span>',\n",
       " '无人知晓  偏安一隅',\n",
       " '生活永远在继续<span class=\"emoji emoji1f483\"></span>',\n",
       " '快乐点呗',\n",
       " '人要活成两种样子发光和不发光，不发光的时候是在为发光做准备',\n",
       " '开心就好！！！',\n",
       " '一起玩耍啊😈',\n",
       " \"wherever He leads I'll go\",\n",
       " '无生活，不烦恼~',\n",
       " '<span class=\"emoji emoji1f436\"></span><span class=\"emoji emoji1f52b\"></span>🌡️',\n",
       " '<span class=\"emoji emoji1f60a\"></span> <span class=\"emoji emoji1f60a\"></span> <span class=\"emoji emoji1f60a\"></span>',\n",
       " '',\n",
       " '为时未晚',\n",
       " '好的',\n",
       " '',\n",
       " '',\n",
       " '昨夜星辰昨夜风。',\n",
       " '太阳公公出来了',\n",
       " '凡事有交代，件件有着落， 事事有回音',\n",
       " '陪你走过的每段路，还在脑海中挥之不去！！！',\n",
       " 'NOW is all that matters~',\n",
       " '🔆未来可期🔆',\n",
       " '',\n",
       " '',\n",
       " '🧸ྀི',\n",
       " '想要人前显贵，就要人后遭罪',\n",
       " 'lmm',\n",
       " '<span class=\"emoji emoji26a0\"></span>️你的访问已被记录             \\u2003\\u2003   \\u2003\\u2003\\u2003ִִ   ִ',\n",
       " 'uy',\n",
       " '',\n",
       " '我在看着你',\n",
       " '',\n",
       " '苦难并不是财富，对苦难的思考才是。',\n",
       " '为梦想而生',\n",
       " '',\n",
       " '若有天我不复勇往，能否坚持走完这一场',\n",
       " 'Diamonds or rust  ',\n",
       " '25571765677776765',\n",
       " '平凡日子里的小确幸',\n",
       " '',\n",
       " '做一只自由的鸟。',\n",
       " '',\n",
       " '',\n",
       " '                   ',\n",
       " '',\n",
       " '',\n",
       " '等待人生的第一笔单',\n",
       " '',\n",
       " '本号已满，加jingyun145145，朋友圈都是一样的。',\n",
       " '',\n",
       " '当个好爸爸~',\n",
       " '3D打印样品，金属CNC，开模注塑等，如有需要，欢迎来图咨询！！',\n",
       " '夏虫不可语冰',\n",
       " '',\n",
       " '',\n",
       " '严以修身严以用权严以律己谋事要实创业要实做人要实',\n",
       " '唤来了星繁，似灭似绚烂',\n",
       " '',\n",
       " '与其当个好人，不如做个妙人',\n",
       " 'The more you seek, the more you’ll gain.',\n",
       " '∅',\n",
       " '1124',\n",
       " '',\n",
       " '良禽择木而栖',\n",
       " '雾里看花',\n",
       " 'He who has a why to live can bear almost any how.',\n",
       " '拾集無法復刻的時光',\n",
       " '<span class=\"emoji emoji1f31b\"></span><span class=\"emoji emoji1f339\"></span><span class=\"emoji emoji1f42c\"></span><span class=\"emoji emoji1f339\"></span><span class=\"emoji emoji2747\"></span><span class=\"emoji emoji1f339\"></span><span class=\"emoji emoji1f433\"></span><span class=\"emoji emoji1f339\"></span><span class=\"emoji emoji1f31b\"></span>',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '万物寂静',\n",
       " '',\n",
       " '上海新莱坞(XINLYWOOD)影业创始人',\n",
       " '三思而后行',\n",
       " '健康不易，且行且珍惜',\n",
       " 'To file the hour - that is happiness',\n",
       " 'Change  for  better',\n",
       " '',\n",
       " '雨过天晴 春暖花开',\n",
       " '来日方长',\n",
       " '吾心向山，君心向水',\n",
       " '星星温柔泛滥 人间至善',\n",
       " '',\n",
       " '我愿与你共黄昏。',\n",
       " '你没有如期归来，这正是离别的意义。',\n",
       " 'Do cool things that matter.',\n",
       " '真实的活着，不要违背自己的本心。',\n",
       " 'Focus',\n",
       " '',\n",
       " '晚来天欲雪，能饮一杯无？',\n",
       " '人之一生，可以通晓多少领域？',\n",
       " '',\n",
       " '加油！',\n",
       " '任重道远',\n",
       " '健康不是第一，而是唯一！',\n",
       " '成长是最好的目标',\n",
       " '',\n",
       " '',\n",
       " '最懂你的人、不一定认识你',\n",
       " '幸福并感激着',\n",
       " '沧海横流，方显英雄本色。树高万丈不忘根，人若辉煌不忘本！',\n",
       " '',\n",
       " '微博：八度音乐夏泽宇      吉他教学，吉他销售，买琴有优惠',\n",
       " '那什么来支撑你的梦想，能力，视野，见识？一路无悔～～',\n",
       " '别怕路长梦远，总有星河照耀。',\n",
       " '我又酸又菜又多余！以后我叫酸菜鱼！',\n",
       " '开始相信命运',\n",
       " '',\n",
       " '但为君故，开车至今',\n",
       " '',\n",
       " '<span class=\"emoji emoji1f60a\"></span><span class=\"emoji emoji1f60a\"></span><span class=\"emoji emoji1f60a\"></span><span class=\"emoji emoji1f60a\"></span><span class=\"emoji emoji1f63f\"></span>😴😴',\n",
       " 'only if you asked to see me,our meeting would be meaningful.',\n",
       " 'practice makes perfect',\n",
       " '',\n",
       " 'All models are wrong, but',\n",
       " '',\n",
       " '',\n",
       " '我辈既务斯业，便当专心用功',\n",
       " '骥尾',\n",
       " 'to be a better girl',\n",
       " '',\n",
       " 'carry you',\n",
       " 'career objective:Software Developer Engineer',\n",
       " '你当像鸟飞往你的山',\n",
       " '',\n",
       " '無垢',\n",
       " '',\n",
       " '',\n",
       " '你是否质疑过你眼中现实世界的本质。',\n",
       " 'Don’t judge',\n",
       " '',\n",
       " 'keep learning',\n",
       " '保持热爱，奔赴山海。',\n",
       " '',\n",
       " '我的太阳<span class=\"emoji emoji2600\"></span>',\n",
       " '',\n",
       " '18108839165',\n",
       " '♪( ´θ｀)ノ',\n",
       " '胸怀万千世界，何止一城繁华 <span class=\"emoji emoji1f47c\"></span>',\n",
       " '专心做事',\n",
       " '无挂碍故 无有恐怖',\n",
       " '',\n",
       " '不要只看到已经失去的，要看到我们还拥有的!',\n",
       " '好奇，专注，毅力，自省',\n",
       " 'adjust',\n",
       " '无愧于心，不惑于情🤭',\n",
       " '',\n",
       " '💥',\n",
       " '会有人来告诉你，你永远值得最好的',\n",
       " '鲁迅看战神',\n",
       " '',\n",
       " '玻璃晴朗，橘子辉煌',\n",
       " '粉红 🦄️',\n",
       " 'Music is in my soul',\n",
       " '不骄不躁，以终为始，为而不争',\n",
       " '²º ²º',\n",
       " '湖海意悠悠，烟波下钓钩。',\n",
       " '<span class=\"emoji emoji1f30a\"></span> <span class=\"emoji emoji1f30a\"></span> <span class=\"emoji emoji1f30a\"></span> <span class=\"emoji emoji1f334\"></span> <span class=\"emoji emoji1f334\"></span> <span class=\"emoji emoji1f334\"></span>',\n",
       " '时间用在哪里，花就开在哪里。',\n",
       " '黑色的不是夜晚，是满腔的孤单',\n",
       " '我叫阮钦',\n",
       " '要就要独一无二不可替代',\n",
       " '设置个签名中',\n",
       " '生活是苦难的，我又划着我的断桨出发了',\n",
       " '善其事',\n",
       " '',\n",
       " '放宽心 你会变得更幸运<span class=\"emoji emoji1f33f\"></span>',\n",
       " '我有绿章通帝座，神仙需用读书人。',\n",
       " '山川河海',\n",
       " '植根于内心的修养，以约束为前提的自由，为别人着想的善良',\n",
       " '人生如战场，战场如人生，做一个勇敢的无名英雄。',\n",
       " '你是大西洋暖流，我是摩尔曼斯克港。',\n",
       " '愿我所爱都平安顺遂',\n",
       " '生命没有草稿   年华不容浪费',\n",
       " '永远年轻，永远热泪盈眶',\n",
       " '在路上~',\n",
       " '带上牧马人，穿越罗布泊，倒在亚马逊，这就是我的梦想',\n",
       " '勤学似春起之苗，不见其增，而日有所长。',\n",
       " '我是一个努力干活，还不黏人的小妖精',\n",
       " 'Be courageous fool .',\n",
       " '',\n",
       " '为自己的头脑和心灵招兵买马，不气馁，有召唤，爱自由。',\n",
       " '<span class=\"emoji emoji1f490\"></span>',\n",
       " '八九也是我',\n",
       " '@@',\n",
       " '',\n",
       " '',\n",
       " '想看看小C什么时候来看我朋友圈？',\n",
       " '',\n",
       " '善始者实繁，克终者盖寡',\n",
       " '当生活给你一百个理由哭泣时，你就拿出一千个理由笑给它看。',\n",
       " '明知没                            偏要问',\n",
       " '学习一个',\n",
       " 'プレゼンス',\n",
       " '',\n",
       " 'When I see your eyes <span class=\"emoji emoji1f440\"></span>',\n",
       " '活着',\n",
       " \"^ㅅ')۶:.♡\",\n",
       " '',\n",
       " '自娱自乐',\n",
       " '',\n",
       " '唯一最爱zcc😗😗 😗 😗 😗 😗 😗 😗',\n",
       " '最大的问题是想得太多做得太少',\n",
       " '待到雪化时',\n",
       " 'The Best Or Nothing',\n",
       " '13852403657',\n",
       " 'you lied to him   \\u2003\\u2003   \\u2003\\u2003\\u2003ִִ\\n\\n\\nִ',\n",
       " '你为了长颈前的奢侈品绕远\\n我为了几里外的麻雀而雪埋',\n",
       " '红红火火',\n",
       " '',\n",
       " '',\n",
       " '',\n",
       " '不抱怨，不将就，有自由，有光芒',\n",
       " '灯火通明；春暖花开',\n",
       " '',\n",
       " '不听不听，王八念经',\n",
       " '',\n",
       " '',\n",
       " '有趣的灵魂',\n",
       " '',\n",
       " '勇毅专精，勤慎公忠',\n",
       " '没有猫的狗世界！！',\n",
       " '',\n",
       " '',\n",
       " '专注',\n",
       " '小牛向前冲后，小马再奔腾。',\n",
       " '活了一天就少一天，让每天过的有意义<span class=\"emoji emoji1f618\"></span><span class=\"emoji emoji1f618\"></span><span class=\"emoji emoji1f618\"></span>',\n",
       " '',\n",
       " '杯中有冰可乐就好！',\n",
       " '独钓寒江雪',\n",
       " '锦上添花人人趋之，雪中送炭才最可贵。',\n",
       " '想家',\n",
       " '盛夏正要一天一天一天的灿烂',\n",
       " '不问将来，只做当世。',\n",
       " '注册会计师，MBA  知方寸',\n",
       " '一无所有',\n",
       " '好多东西，在同一个维度肯定有它的极限，但是可以有很多维度。',\n",
       " 'Work for live, Life for love!',\n",
       " '打扰了',\n",
       " '',\n",
       " '君子坦荡荡',\n",
       " '我，王子炀，要研究非线性泛函分析',\n",
       " '',\n",
       " 'Lazy',\n",
       " '及时止损',\n",
       " '当然是你比游戏重要啊',\n",
       " 'znxfxy',\n",
       " '活不过一集，死于话多。',\n",
       " '别人有的，你也都会有的<span class=\"emoji emoji1f361\"></span><span class=\"emoji emoji1f366\"></span><span class=\"emoji emoji1f367\"></span><span class=\"emoji emoji1f308\"></span><span class=\"emoji emoji1f305\"></span>',\n",
       " '',\n",
       " 'Dream big, act small.',\n",
       " '<span class=\"emoji emoji1f4a3\"></span> 148',\n",
       " '当旧认知无法解决新问题时:创新➕ 看书',\n",
       " '',\n",
       " '常怀感恩',\n",
       " '',\n",
       " 'life is an interesting maze',\n",
       " '',\n",
       " '日久见人心，平淡才是真、',\n",
       " 'Expecto Patronum',\n",
       " '',\n",
       " '每个人都在奋不顾身，不是只有你受尽委屈',\n",
       " '温故而知新',\n",
       " '',\n",
       " '工作：周二到周日早9-晚7 周一休息 报修4001001111',\n",
       " '谋事在人',\n",
       " '？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？',\n",
       " '企者不立,跨者不行',\n",
       " '',\n",
       " 'everybody在你头上爆扣',\n",
       " '陈先生要好好努力呀',\n",
       " '长期关圈，鲜少冒泡，感谢关注<span class=\"emoji emoji1f497\"></span>',\n",
       " '常想一二  不思八九',\n",
       " '    要瘦 要健康！ <span class=\"emoji emoji1f495\"></span>',\n",
       " 'wishes can change',\n",
       " '周二～周日早9～晚7，周一休息，维修请联系客服4001001111',\n",
       " '嘿',\n",
       " '路遥知马力  日久见真心',\n",
       " '上班时间上午九点至七点。周二休息',\n",
       " '安好',\n",
       " '每个坚定的选择都值得温柔以待<span class=\"emoji emoji1f308\"></span>',\n",
       " '阳光之下，皆为云霞',\n",
       " '所有过往皆为序章',\n",
       " '正大方圆',\n",
       " '人生不能太过圆满 ，求而不得未必是遗憾.',\n",
       " 'Doing is faster. Iterate.关注不变的东西。',\n",
       " '夕惕若厉',\n",
       " '',\n",
       " '亦余心之所善兮，虽九死其犹未悔',\n",
       " '宁静致远',\n",
       " 'keep your spirit soaring high',\n",
       " '人 在劳动中进化',\n",
       " '博观约取，厚积薄发\\n微分现实，积分理想\\n稀疏生活，聚类梦想',\n",
       " '人间失格，未来可期。',\n",
       " '多数人想改变世界，但却罕有人想改变自己',\n",
       " '专心、专注、专业',\n",
       " '没有文化的人不伤心',\n",
       " 'Too tired to fight',\n",
       " '我是你的糖心柚',\n",
       " '',\n",
       " '词不达意',\n",
       " '经济基础决定上层建筑',\n",
       " '工作号。',\n",
       " 'n 55iw ! n paau ! n a∧07 !\\n\\n你拿倒了呢',\n",
       " '不要害怕  向前走鸭',\n",
       " '珍珠奶茶其实是一种疙瘩汤。',\n",
       " '',\n",
       " '如果这世界上真有奇迹\\n那只是努力的另一个名字',\n",
       " '纷乱冗杂的世界里，总是屈服于温柔',\n",
       " '我在这里啊。',\n",
       " '℡13390544811',\n",
       " '',\n",
       " 'Wer die Wahl hat,hat die Qual',\n",
       " '飘风不终朝，骤雨不终日',\n",
       " '爱你所爱 行你所行 听从你心 无问西东',\n",
       " '逆风飞翔，以图山河',\n",
       " 'This time,nothing is impossible!',\n",
       " '或许走得慢，但从不后退。',\n",
       " '\\u2062\\u2062天大寒\\n\\n砚冰坚\\n\\n手指不可屈伸\\n\\n弗之怠',\n",
       " '你不能颓。',\n",
       " '胜友如云',\n",
       " '大梦谁先觉，平生我自知。\\n草堂春睡足，窗外日迟迟。',\n",
       " '溯洄从之，道阻且长。',\n",
       " '',\n",
       " '吹面不寒杨柳风',\n",
       " 'we are infinite',\n",
       " '船头爱茶煲',\n",
       " '好好学习！',\n",
       " '',\n",
       " '主修厨艺，辅修机械',\n",
       " 'IT<span class=\"emoji emoji1f436\"></span>熬夜的动力，来源于deadline的逼近和白天碌碌无为的愧疚。',\n",
       " '催人改变的是责任',\n",
       " '',\n",
       " '云卷云舒，去留无意',\n",
       " '洛阳春景',\n",
       " '让坚持成为一种习惯',\n",
       " '我想去卖米线，卖粑粑卷，烧烤都OK，要一起吗？',\n",
       " 'Life is tough，you must be tougher than it.',\n",
       " '',\n",
       " '自动化算法精髓在有意义计算机算法精髓在有思想人工智能有创造',\n",
       " '世间行走 皆是妖怪',\n",
       " '生活有望穿秋水的期待，\\n    也会有意想不到的欣喜。',\n",
       " 'KarryWang<span class=\"emoji emoji1f499\"></span>',\n",
       " '古丽今天自律了吗🤔',\n",
       " '',\n",
       " '',\n",
       " '热爱世间  热爱万物  无例外  无最爱',\n",
       " '糖炒玻璃渣_',\n",
       " '最爱啾啾蔻',\n",
       " '',\n",
       " '今天不学习，明天变垃圾',\n",
       " '好吃的美食各种各样 想减的脂肪一斤不下',\n",
       " '',\n",
       " '',\n",
       " '0️⃣<span class=\"emoji emoji27a1\"></span>️1️⃣',\n",
       " '少年侠气 柔软心肠',\n",
       " '错把陈醋当成墨~写得人生一世酸！',\n",
       " '言必行，行必果',\n",
       " '有事QQ联系']"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.Signature.tolist()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3.保存信息"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "只需登陆一次，将信息保存下来，避免重复登录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('friends.pickle', 'wb') as f:\n",
    "    pickle.dump(friends, f)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "保存完成后，以后使用只需要使用以下方式加载"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "朋友数：\t 705\n"
     ]
    }
   ],
   "source": [
    "with open('friends.pickle', 'rb') as f:\n",
    "    friends = pickle.load(f)\n",
    "print('朋友数：\\t', len(friends))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
